<%= fields_for Spamaway.new do |spam| %>

  <div class="form-group spamaway">

      <%= translation('users._form.are_you_human') %>
    <p style="font-size: 1.3em;">
      <%= translation('users._form.spam_filtering') %>
    </p>

    <% vars = [:statement1, :statement2, :statement3, :statement4] %>
    <% turingtest = Spamaway.get_pairs vars.length %>
    <% turingtest.each_index do |i| %>

        <div class="btn-group d-flex" role="group">
          <% [0,1].each_with_index do |s, j| %><% statement = turingtest[i][s] %>
            <button type="button" class="col-5 btn btn-outline-secondary" style="font-size:3em;text-align:left;<% if i.odd? %> background:#eef;<% end %>" id="spamaway-<%= caller %>-<%= i.to_s + j.to_s %>">
            <label id="selectAnimal" for="spamaway_statement_<%= caller %>_<%= i.to_s + j.to_s %>">
            <%= spam.radio_button vars[i], statement, { id: "spamaway_statement_#{caller}_#{i.to_s}#{j.to_s}" } %> <%= statement %>
            </button>
          <% end %>
        </div>
        <br />

    <% end %>

  </div>

  <div class="form-group d-none">
    <%= spam.text_area :follow_instructions, { class: "form-control col-lg-6",
                                             rows: 8,
                                             tabindex: 7,
                                             placeholder: I18n.t('users._form.dont_write_here'),
                                             id: 'spamaway-'+caller }
    %>

  </div>

<% end %>
